// updated: 140106-2124;
#include "StdAfx.h"
#include "LFactor.h"
#include "LParam.h"


static LParam * mparam = NULL;



LFactor::LFactor(void)
{
	TRACE(TEXT("->lFactor::lFactor().\n"));
	//mstate = 0;
	
	//glog = new Logger();	//TRACE(_T("---lfactor: logger: 0x%x\n"), glog);
	//gptAddress(glog, TEXT("lfactor.glog"), sizeof(Logger));

	ghash = new LHash();	//TRACE(_T("---lfactor: hash: 0x%x\n"), ghash);
	gptAddress(ghash, TEXT("lfactor.ghash"), sizeof(LHash));

	mparam = new LParam();	//TRACE(_T("---lfactor: param: 0x%x\n"), mparam);
	gptAddress(mparam, TEXT("lfactor.mparam"), sizeof(LParam));
	//ghash->add("param", gparam);
}

LFactor::~LFactor(void)
{
	TRACE(TEXT("->lFactor::~lFactor().\n"));
	
	if( mparam ) { delete mparam; mparam = NULL; }
	
	if( ghash ) { delete ghash; ghash = NULL; }
	//if( glog ) { delete glog; glog = NULL; }
	//lckState(mstate, 4);
}

int LFactor::init( )
{
	//VERIFY(mstate == state );
	//mstate++;
	//lckStateInc(mstate, state);

	int ret = 0;

	//if( glog->linit() < 0 )	return --ret;
	if( ghash->linit() < 0 ) return --ret;
	if( mparam->linit() < 0 ) return --ret;

	return ret; //inits();

	//return ret;
}
void LFactor::exit( )
{
	TRACE(TEXT("-> lFactor::exit().\n"));
	//VERIFY( mstate == state );
	//mstate++;
	//lckStateInc(mstate, state);

	//exits();

//	mparam->lexit();
	
//	ghash->lexit();
//	glog->lexit();

	//ghash->del( gparam );
	//ghash->del( gconfigfile );
	//ghash->del( ghash );
	//ghash->del( glog );

	//destory();
}
